package com.hrvsr.scheduler.standardalone;

import java.util.concurrent.ConcurrentHashMap;

import com.hrvsr.common.Request;
import com.hrvsr.scheduler.DuplicateRemover;

public class HashSetDuplicateRemover implements DuplicateRemover {
	private ConcurrentHashMap<String, Object> visitedRequests = new ConcurrentHashMap<String, Object>();

	@Override
	public boolean contains(Request request) {
		return visitedRequests.containsKey(String.valueOf(request.hashCode()));
	}

	@Override
	public void add(Request request) {
		visitedRequests.put(String.valueOf(request.hashCode()), "1");
	}

}
